﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Web.Mvc;
namespace RBAC.Web.Models
{
	public class RoleUserModel
	{	
			    
					 //Autokey is PK
						[Remote("doesIdExist", "RoleUser", HttpMethod = "POST", AdditionalFields = "Mode, OldValue", ErrorMessage = "Id already exists. Please enter a different Id")]
						[DisplayName("Id")]
						public int Id { get; set; }
									 
					 
						[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
						[DisplayName("CreateDate")]
						public DateTime? CreateDate { get; set; }
									 
					 
						[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
						[DisplayName("UpdateDate")]
						public DateTime? UpdateDate { get; set; }
									 
					 
						[DisplayName("UpdateBy")]
						public int? UpdateBy { get; set; }
									 
					 
						[DisplayName("Version")]
						public int? Version { get; set; }
									 
												[Required]
							[Range(1, 1000000, ErrorMessage = "Please select Role")]
							[DisplayName("Role")]
							public int Role { get; set; }
							 /*LookupClassAttribute*/
																			public String RoleRoleCode { get; set; }
																 /*LookupClassAttribute*/
																			public String RoleRoleName { get; set; }
																									 
												[Required]
							[Range(1, 1000000, ErrorMessage = "Please select User")]
							[DisplayName("User")]
							public int User { get; set; }
							 /*LookupClassAttribute*/
																			public String UserUsername { get; set; }
																 /*LookupClassAttribute*/
																			public String UserEmail { get; set; }
																									 
					 
						[Required(ErrorMessage="Please select ProjectId")]
						[DisplayName("ProjectId")]
						public int ProjectId { get; set; }
									
				// For PopLookup
				public List<RoleUserModel> ListOfRoleUser { get; set; }
				public string[] RequiredFields { get; set; }
	}
}